import request from '@/axios'
import { UnitTree } from '../types/dept'

function formatRequestUri(name) {
  return 'hr/unit/' + name
}
export function getDeptTree(data) {
  return request.post({
    url: formatRequestUri('GetDeptTree'),
    data
  })
}

export function getTree(data): Promise<UnitTree[]> {
  return request.post({
    url: formatRequestUri('getTree'),
    data
  })
}
export function GetNameList(ids: string[]): Promise<string[]> {
  return request.post({
    url: formatRequestUri('GetNameList'),
    data: ids
  })
}
